﻿namespace PokerSimulator
{
	using System.Globalization;

	using PugLib;

	public class CardValue : AutoOperators
	{
		public const int NullValue = 0;
		public const int TenValue = 10;

		private readonly int _value;

		public CardValue(int value)
		{
			_value = value;
		}

		public int Value
		{
			get { return _value; }
		}

		public override int CompareTo(object obj)
		{
			Card objV = obj as Card;
			return objV == null ? 1 : _value.CompareTo(objV.Value);
		}


		public override string ToString()
		{
			switch (_value)
			{
				case 14:
					return "Ace";
				case 13:
					return "King";
				case 12:
					return "Queen";
				case 11:
					return "Jack";
				default:
					return _value.ToString(CultureInfo.CurrentCulture);
			}
		}

		public override int GetHashCode()
		{
			return _value.GetHashCode();
		}
	}
}